/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Persistencia;

import Entidades.Licencia;
import java.util.Date;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.Query;

/**
 *
 * @author diego
 */
public class JPAControllerLicencias extends JpaController {

    public List<Licencia> buscarPorFechas(Date fi, Date ff) {
        EntityManager em = ConexionAdmin.getInstance().getEntityManager();
        String jpql = "SELECT c FROM Licencia c WHERE c.fechaInicioLicencia < ?1";
        Query query = em.createQuery(jpql);
        query.setParameter(1, ff);
        return query.getResultList();
    }
}
